﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tab_AD_List.aspx.cs" Inherits="AdminCMS_tab_Advertisement_List" %>

<%@ Register Src="~/UIControls/ProSplitPage.ascx" TagName="ProSplitPage" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>广告列表浏览</title>
<style type="text/css">
td {text-align:left;}
.list_title { padding-left:20px; height:22px;}
</style>
<script type="text/javascript" src="js/UIMethod.js"></script>
</head>

<body style="text-align:center;">


<form id="form1" runat="server">


<div style="text-align:center;">
版位类型:
    <asp:DropDownList ID="ddl_ZoneType" runat="server">
        <asp:ListItem Text="<-- 请选择 -->" Value="0" Selected="true"></asp:ListItem>
        <asp:ListItem Text="占位横幅" Value="1"></asp:ListItem>
        <asp:ListItem Text="弹出窗口" Value="2"></asp:ListItem>
        <asp:ListItem Text="漂浮移动" Value="3"></asp:ListItem>
        <asp:ListItem Text="固定位置" Value="4"></asp:ListItem>
        <asp:ListItem Text="随屏移动" Value="5"></asp:ListItem>
        <asp:ListItem Text="文字代码" Value="6"></asp:ListItem>
    </asp:DropDownList>
    &nbsp;
    广告类型:
    <asp:DropDownList ID="ddl_ADType" runat="server">
        <asp:ListItem Text="<-- 请选择 -->" Value="0" Selected="true"></asp:ListItem>
        <asp:ListItem Text="图片" Value="1"></asp:ListItem>
        <asp:ListItem Text="动画" Value="2"></asp:ListItem>
        <asp:ListItem Text="文本" Value="3"></asp:ListItem>
        <asp:ListItem Text="代码" Value="4"></asp:ListItem>
        <asp:ListItem Text="页面" Value="5"></asp:ListItem>        
    </asp:DropDownList>
    &nbsp;
    是否活动:
    <asp:DropDownList ID="ddl_IsActive" runat="server">
			    <asp:ListItem Value="0" Selected="true">横幅广告</asp:ListItem>
			    <asp:ListItem Value="1">活动广告</asp:ListItem>
			</asp:DropDownList>	
    &nbsp;
    <input type="button" value="搜索" onclick="SearchEvent();" />
</div>

<table cellpadding="0" cellspacing="0" width="100%" border="0" class="border">
	<tr>
		<td class="title_left" style="padding-left:20px;width:60px;">
		<input type="checkbox" onclick="all_chkBox_check(this.checked);" />全选
		</td>
		<td class="title_left" style="padding-left:20px;">自动编号</td>
		<td class="title_left" style="padding-left:20px;">广告名称</td>		
		<td class="title_left" style="padding-left:20px;">广告类型</td>		
		<td class="title_left" style="padding-left:20px;">版位编号</td>
		<td class="title_left" style="padding-left:20px;">浏览量</td>
		<td class="title_left" style="padding-left:20px;">发布日期</td>
		<td class="title_left" style="padding-left:20px; width:50px;">操作</td>
	</tr>
	
	<!-- 重复区 start -->
	<asp:Repeater ID="repeater1" Runat="server">
		<ItemTemplate>
		
		<tr onmouseover='this.className="tdbg_left";oPopupShow(<%# Eval("adv_ImgWidth").ToString() + "," + Eval("adv_ImgHeight").ToString() + "," + Eval("adv_ADType").ToString()  + ",\"" + Eval("adv_ImgUrl").ToString() + "\"" %>);' onmouseout="this.className='';oPopup.hide();">
			<td class="list_title" style="padding-left:20px;"><input type="checkbox" value='<%# Eval("adv_ID") %>' name="check_class"></td>			
            <td class="list_title"><%# Eval("adv_ID") %></td>
            <td class="list_title"><%# Eval("adv_ADName") %></td>           
            <td class="list_title"><%# Eval("adv_ADType") %></td>            
            <td class="list_title"><%# Eval("adv_ZoneID") %></td>
			<td class="list_title"><%# Eval("adv_Clicks") %></td>
			<td class="list_title"><%# Eval("adv_PubDate") %></td>            
			
			<td class="list_title"><a href='<%# "tab_AD_Fix.aspx?ID=" + Eval("adv_ID") %>'>修改</a></td>
		</tr>
		
		</ItemTemplate>
	</asp:Repeater>
	<!-- 重复区 end -->
</table>
<!--阴影-->
	<div style="width:98%;" class="tdbg_left2">
	</div>
	<!--阴影end-->
	
<!-- 分页控件 start -->
<div style="text-align:right;"><uc1:ProSplitPage ID="ProSplitPage1" runat="server" MaxRows="20" /></div>
<!-- 分页控件 end -->

<div class="tCenter" style="text-align:center;">
	<input type="button" value="添加" onclick="SearchEvent('tab_AD_Add.aspx');" />
	<input type="button" value="将所选删除" onclick="DeleteToSelected('form1','tab_AD_Del.aspx');" />
</div>

<div style="margin-top:10px; text-align:center;" class="nav_menu">
		搜索： 
		关键词:<asp:TextBox ID="txt_keyword" runat="server"></asp:TextBox>&nbsp;
		<input type="button" value="搜索" onclick="SearchEvent();" />
</div>

</form>
</body>
</html>
<link id="mylink" href="css/style<%=UIMethod.GetStyleValue()%>.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript">
function SearchEvent(URL)
{
	if(typeof(URL) == 'undefined') { URL = ''; }
	location = URL + "?ZoneType=" + document.getElementById('ddl_ZoneType').value +	
	                "&ADType=" + document.getElementById('ddl_ADType').value +	
	                "&IsActive=" + document.getElementById('ddl_IsActive').value +	
	                "&KeyWord=" + escape(document.getElementById('txt_keyword').value);
	                
}
</script>

<script type="text/javascript">
var oPopup = window.createPopup();
function oPopupShow(w, h, ContentType, FileURl)
{    
    var t = event.clientY + 20;
    var l = event.clientX;
    var content = FileURl;

    switch(ContentType)
    {
        case 1:
            content = "<img src='" + FileURl + "' border='0' width='100%' height='100%' />";
            break;
        case 2:
            content = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' " +
                "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' " +
                "width='100%' height='100%'>" +
                "<param name='movie' value='" + FileURl + "'>" +
                "<param name='wmode' value='transparent'>" +
                "<param name='quality' value='low'>" +
                "<embed src='" + FileURl + "'  quality='low' " + 
                "pluginspage='http://www.macromedia.com/shockwave/download/index.cgi" + 
                "?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' wmode='transparent' " + 
                "width='100%' height='100%'></embed></object>'";
            break;    
    }
    var oPopBody = oPopup.document.body;
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML = content;
    oPopup.show(l, t, w, h, document.body);
}
</script>